package com.xuerhua.yxt.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xuerhua.yxt.dao.TermInfoMapper;
import com.xuerhua.yxt.model.TermInfo;
import com.xuerhua.yxt.service.ITermInfoService;
import com.xuerhua.yxt.utils.BeanUtils;
import com.xuerhua.yxt.view.TermView;

@Service("termInfoService")
public class ITermInfoServiceImpl implements ITermInfoService {
	
	@Autowired
	private TermInfoMapper termInfoMapper;

	@Override
	public int insertSelective(TermInfo record) {
		return termInfoMapper.insertSelective(record);
	}

	@Override
	public TermInfo selectByPrimaryKey(Integer id) {
		return termInfoMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(TermInfo record) {
		return termInfoMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public TermView selectCurrentTerm() {
		TermInfo termInfo = termInfoMapper.selectCurrentTerm();
		return BeanUtils.copyAs(termInfo, TermView.class);
	}

	@Override
	public List<TermInfo> selectList(Integer schoolId) {
		return termInfoMapper.selectList(schoolId);
	}

	@Override
	public int delByPrimaryKey(List<String> ids) {
		return termInfoMapper.delByPrimaryKey(ids);
	}

}
